﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace WeiSha.Core.Parameters.Authorization
{
	// Token: 0x02000039 RID: 57
	internal class Edition
	{
		// Token: 0x170000F0 RID: 240
		// (get) Token: 0x06000260 RID: 608 RVA: 0x00010F80 File Offset: 0x0000F180
		internal static Edition[] Items
		{
			get
			{
				return Edition._items;
			}
		}

		// Token: 0x06000261 RID: 609 RVA: 0x00010F88 File Offset: 0x0000F188
		internal static Edition GetItem(int level)
		{
			bool flag = level < 0 || level > Edition.Items.Length - 1;
			if (flag)
			{
				level = 0;
			}
			return Edition.Items[level];
		}

		// Token: 0x06000262 RID: 610 RVA: 0x00010FBC File Offset: 0x0000F1BC
		internal static string GetEdition(int level)
		{
			bool flag = level < 0 || level > Edition.Level.Length - 1;
			if (flag)
			{
				level = 0;
			}
			return Edition.Level[level];
		}

		// Token: 0x06000263 RID: 611 RVA: 0x00010FF0 File Offset: 0x0000F1F0
		internal static string GetLabel(int level)
		{
			bool flag = level < 0 || level > Edition.Level.Length - 1;
			if (flag)
			{
				level = 0;
			}
			return Edition._items[level].Label;
		}

		// Token: 0x06000264 RID: 612 RVA: 0x00011028 File Offset: 0x0000F228
		internal static IDictionary<string, int> DataItemsChinese(int level)
		{
			Edition item = Edition.GetItem(level);
			return Edition.DataItemsChinese(item);
		}

		// Token: 0x06000265 RID: 613 RVA: 0x00011048 File Offset: 0x0000F248
		internal static IDictionary<string, int> DataItemsChinese(Edition limit)
		{
			IDictionary<string, int> dictionary = new Dictionary<string, int>();
			Type type = limit.GetType();
			foreach (PropertyInfo propertyInfo in type.GetProperties())
			{
				bool visible = Entity.Get.GetVisible(propertyInfo.Name);
				bool flag = !visible;
				if (!flag)
				{
					bool flag2 = propertyInfo.PropertyType == typeof(int);
					if (flag2)
					{
						string text = Entity.Get[propertyInfo.Name];
						int num = (int)propertyInfo.GetValue(limit, null);
						dictionary.Add(text, num);
					}
				}
			}
			return dictionary;
		}

		// Token: 0x06000266 RID: 614 RVA: 0x000110F4 File Offset: 0x0000F2F4
		internal static IDictionary<string, int> DataItems(int level)
		{
			Edition item = Edition.GetItem(level);
			return Edition.DataItems(item);
		}

		// Token: 0x06000267 RID: 615 RVA: 0x00011114 File Offset: 0x0000F314
		internal static IDictionary<string, int> DataItems(Edition limit)
		{
			IDictionary<string, int> dictionary = new Dictionary<string, int>();
			Type type = limit.GetType();
			foreach (PropertyInfo propertyInfo in type.GetProperties())
			{
				bool visible = Entity.Get.GetVisible(propertyInfo.Name);
				bool flag = !visible;
				if (!flag)
				{
					bool flag2 = propertyInfo.PropertyType == typeof(int);
					if (flag2)
					{
						int num = (int)propertyInfo.GetValue(limit, null);
						dictionary.Add(propertyInfo.Name, num);
					}
				}
			}
			return dictionary;
		}

		// Token: 0x170000F1 RID: 241
		// (get) Token: 0x06000268 RID: 616 RVA: 0x000111B1 File Offset: 0x0000F3B1
		// (set) Token: 0x06000269 RID: 617 RVA: 0x000111B9 File Offset: 0x0000F3B9
		public string Name { get; internal set; }

		// Token: 0x170000F2 RID: 242
		// (get) Token: 0x0600026A RID: 618 RVA: 0x000111C2 File Offset: 0x0000F3C2
		// (set) Token: 0x0600026B RID: 619 RVA: 0x000111CA File Offset: 0x0000F3CA
		public string Label { get; internal set; }

		// Token: 0x170000F3 RID: 243
		// (get) Token: 0x0600026C RID: 620 RVA: 0x000111D3 File Offset: 0x0000F3D3
		// (set) Token: 0x0600026D RID: 621 RVA: 0x000111DB File Offset: 0x0000F3DB
		public bool Enable { get; internal set; }

		// Token: 0x170000F4 RID: 244
		// (get) Token: 0x0600026E RID: 622 RVA: 0x000111E4 File Offset: 0x0000F3E4
		// (set) Token: 0x0600026F RID: 623 RVA: 0x000111EC File Offset: 0x0000F3EC
		public int Accounts { get; internal set; }

		// Token: 0x170000F5 RID: 245
		// (get) Token: 0x06000270 RID: 624 RVA: 0x000111F5 File Offset: 0x0000F3F5
		// (set) Token: 0x06000271 RID: 625 RVA: 0x000111FD File Offset: 0x0000F3FD
		public int Teacher { get; internal set; }

		// Token: 0x170000F6 RID: 246
		// (get) Token: 0x06000272 RID: 626 RVA: 0x00011206 File Offset: 0x0000F406
		// (set) Token: 0x06000273 RID: 627 RVA: 0x0001120E File Offset: 0x0000F40E
		public int Subject { get; internal set; }

		// Token: 0x170000F7 RID: 247
		// (get) Token: 0x06000274 RID: 628 RVA: 0x00011217 File Offset: 0x0000F417
		// (set) Token: 0x06000275 RID: 629 RVA: 0x0001121F File Offset: 0x0000F41F
		public int Course { get; internal set; }

		// Token: 0x170000F8 RID: 248
		// (get) Token: 0x06000276 RID: 630 RVA: 0x00011228 File Offset: 0x0000F428
		// (set) Token: 0x06000277 RID: 631 RVA: 0x00011230 File Offset: 0x0000F430
		public int Questions { get; internal set; }

		// Token: 0x170000F9 RID: 249
		// (get) Token: 0x06000278 RID: 632 RVA: 0x00011239 File Offset: 0x0000F439
		// (set) Token: 0x06000279 RID: 633 RVA: 0x00011241 File Offset: 0x0000F441
		public int TestPaper { get; internal set; }

		// Token: 0x170000FA RID: 250
		// (get) Token: 0x0600027A RID: 634 RVA: 0x0001124A File Offset: 0x0000F44A
		// (set) Token: 0x0600027B RID: 635 RVA: 0x00011252 File Offset: 0x0000F452
		public int Knowledge { get; internal set; }

		// Token: 0x170000FB RID: 251
		// (get) Token: 0x0600027C RID: 636 RVA: 0x0001125B File Offset: 0x0000F45B
		// (set) Token: 0x0600027D RID: 637 RVA: 0x00011263 File Offset: 0x0000F463
		public int Article { get; internal set; }

		// Token: 0x170000FC RID: 252
		// (get) Token: 0x0600027E RID: 638 RVA: 0x0001126C File Offset: 0x0000F46C
		// (set) Token: 0x0600027F RID: 639 RVA: 0x00011274 File Offset: 0x0000F474
		public int Notice { get; internal set; }

		// Token: 0x170000FD RID: 253
		// (get) Token: 0x06000280 RID: 640 RVA: 0x0001127D File Offset: 0x0000F47D
		// (set) Token: 0x06000281 RID: 641 RVA: 0x00011285 File Offset: 0x0000F485
		public int Organization { get; internal set; }

		// Token: 0x06000282 RID: 642 RVA: 0x0001128E File Offset: 0x0000F48E
		public Edition(string edition, bool enable)
		{
			this.Label = edition;
			this.Enable = enable;
		}

		// Token: 0x06000283 RID: 643 RVA: 0x000112A8 File Offset: 0x0000F4A8
		public int GetLimitCount(string field)
		{
			PropertyInfo property = base.GetType().GetProperty(field);
			bool flag = property == null;
			int num;
			if (flag)
			{
				num = -1;
			}
			else
			{
				int num2 = (int)property.GetValue(this, null);
				num = num2;
			}
			return num;
		}

		// Token: 0x040000B3 RID: 179
		internal static string[] Domain = new string[]
		{
			"net", "com", "org", "cn", "me", "site", "co", "cc", "info", "net.cn",
			"com.cn", "org.cn"
		};

		// Token: 0x040000B4 RID: 180
		public static string[] Level = new string[] { "社区版", "普及版", "基础版", "标准版", "专业版", "旗舰版", "大客户版" };

		// Token: 0x040000B5 RID: 181
		private static Edition[] _items = new Edition[]
		{
			new Edition("Community", true),
			new Edition("Popular", true)
			{
				Accounts = 300,
				Teacher = 20,
				Subject = 100,
				Course = 200,
				Questions = 5000,
				TestPaper = 100,
				Article = 2000,
				Knowledge = 2000,
				Notice = 1000,
				Organization = 2
			},
			new Edition("Basic", true)
			{
				Accounts = 1000,
				Teacher = 50,
				Subject = 180,
				Course = 400,
				Questions = 20000,
				TestPaper = 400,
				Article = 8000,
				Knowledge = 6000,
				Notice = 0,
				Organization = 2
			},
			new Edition("Standard", true)
			{
				Accounts = 2000,
				Teacher = 100,
				Subject = 200,
				Course = 800,
				Questions = 60000,
				TestPaper = 800,
				Article = 0,
				Knowledge = 0,
				Notice = 0,
				Organization = 3
			},
			new Edition("Professional", true)
			{
				Accounts = 5000,
				Teacher = 300,
				Subject = 500,
				Course = 2000,
				Questions = 300000,
				TestPaper = 2000,
				Article = 0,
				Knowledge = 0,
				Notice = 0,
				Organization = 4
			},
			new Edition("Ultimate", true)
			{
				Accounts = 10000,
				Teacher = 800,
				Subject = 1000,
				Course = 6000,
				Questions = 999999,
				TestPaper = 0,
				Article = 0,
				Knowledge = 0,
				Notice = 0,
				Organization = 4
			},
			new Edition("Custom", false)
			{
				Organization = 6
			}
		};
	}
}
